export const messageExecute = (obj,listeners) => {
    for(let key in listeners) {
        let listener = listeners[key]
        if(typeof listener === 'function') {
            listener(obj)
        }
    }
}

export const addListener = (listeners,id,handler) => {
    listeners[id] = handler
}

export const removeListener = (listeners,id) => {
    delete listeners[id]
}
